﻿<%@ Page Language="C#" MasterPageFile="~/MasterPage/Edit.Master"  AutoEventWireup="true"  CodeBehind="Org_Employee_Edit.aspx.cs" Inherits="Honestysoft.Baseframework.WebUI.SystemManage.Organization.Org_Employee_Edit"  %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <script type="text/javascript" src="../../Uploadify/js/swfobject.js"></script> 
    <script type="text/javascript" src="../../Uploadify/js/jquery.uploadify.min.js"></script> 
    <script type="text/javascript">
        $(document).ready(function () {
            var dataId = document.getElementById("<%=hidID.ClientID %>").value;
            $("#uploadify").uploadify({
                'uploader': '../../Uploadify/js/uploadify.swf',
                'script': 'UploadPhoto.ashx?DataID=' + dataId,
                'cancelImg': '../../Uploadify/js/cancel.png',
                'folder': 'Photo',
                'wmode': 'transparent ',
                'queueID': 'fileQueue',
                'auto': true,
                'multi': false,
                'width': 67,
                'height': 20,
                'buttonImg': '../../Uploadify/images/addPhoto.png',
                'onComplete': function (event, queueID, fileObj, response, data) {
                    document.getElementById('uploadify').style.display = 'none';
                    document.getElementById('imgPhoto').src = 'Photo/' + dataId + fileObj.name.substr(fileObj.name.lastIndexOf('.'));
                }
            });
        });
        function checkCode() {
            var id = '<%=Request.QueryString["ID"] %>';
            if (id != "") {return true;}
            var empCode = document.getElementById("<%=txtEmpCode.ClientID %>").value;
            $.ajax({
                type: "POST",
                url: '<%=Page.ResolveClientUrl("~/") %>Apply/OrganizationTree.ashx?type=9&ID=' + empCode + '&randID=' + escape(new Date()),
                data: "",
                success: function (msg) {
                    if (msg == "1") {
                        alert('系统检测到已存在相同的员工编号，请确认后重新输入！');
                        return false;
                    }
                }
            });
            return true;
        }
</script> 
<script language="javascript" type="text/javascript">
        var opts = null;
        function InitRules() {
            opts = {
                 rules:
                 {
					<%= txtEmpCode.UniqueID%>:{required: true,maxlength: 200},
					<%= txtEmpName.UniqueID%>:{required: true,maxlength: 200},
					<%= numSortCode.UniqueID%>:{required: true,number: true}					
                 },
                 messages:
                 {
					<%= txtEmpCode.UniqueID%>:{required: "员工编号 请输入合适的值",maxlength: "员工编号 最多只能输入200个字符"},
					<%= txtEmpName.UniqueID%>:{required: "姓名 请输入合适的值",maxlength: "姓名 最多只能输入200个字符"},
					<%= numSortCode.UniqueID%>:{required: "排序号 请输入合适的值",number: "排序号 请输入有效的整数"}					
                 },
                 onfocusout:false,
                 onclick:false,
                 onkeyup:false,
                 errorPlacement: function(error, element) {
                    $("#errorContainer").show();
                    error.html("<li>* "+error.html()+"</li>");
                    error.appendTo("#errorContainer");
                 },
                 wrapper:"li"
            }
        }
    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
        <table cellpadding="0" width="100%" cellspacing="0" border="1" class="t1" style="border-bottom:0px;margin-top:2px;">
            <th style="border-bottom:0px">员工基本信息维护</th>
        </table>
       <table cellpadding="0" width="100%" cellspacing="0" border="1" class="t1">
        <tr style="display:none;border:0">
            <td style="width:80px;" ></td>
             <td></td>
              <td style="width:80px;" ></td>
               <td></td>
                <td style="width:80px;" ></td>
                 <td></td>
        </tr>
		<tr>
			<td class="title1">员工编号</td>
			<td><asp:TextBox ID="txtEmpCode" runat="server"  cssClass="input2" MaxLength="200" Width="96%"></asp:TextBox></td>
            <td class="title1">姓名</td>
			<td ><asp:TextBox ID="txtEmpName" runat="server"  cssClass="input2" MaxLength="200" Width="96%"></asp:TextBox></td>
            <td colspan="2" rowspan="8" 
                style="text-align:center;vertical-align:middle;">
                <img id='imgPhoto' src='GetPhoto.aspx?ID=<%=Request["ID"]+"" %>' width="130px" height="160px" border='0' alt='' />
                <div><input type="file" name="uploadify" id="uploadify" style="display:none" /></div>
                
            </td>
		</tr>
		<tr>
			<td class="title1">英文名</td>
			<td><asp:TextBox ID="txtEmpEName" runat="server"  cssClass="input2" MaxLength="200" Width="96%"></asp:TextBox></td>
			<td class="title1">曾用名</td>
			<td><asp:TextBox ID="txtUName" runat="server"  cssClass="input2" MaxLength="200" Width="96%"></asp:TextBox></td>
		</tr>
		<tr>			
			<td class="title1">性别</td>
			<td><asp:DropDownList ID="ddlSex" runat="server" cssClass="input2"  Width="98%"></asp:DropDownList></td>
			<td class="title1">政治面貌</td>
			<td><asp:DropDownList ID="ddlPoliticsVisage" runat="server" cssClass="input2"  Width="98%"></asp:DropDownList></td>
		</tr>
		<tr>
			<td class="title1">出生地</td>
			<td><asp:TextBox ID="txtBirthAdd" runat="server"  cssClass="input2" MaxLength="200" Width="96%"></asp:TextBox></td>
			<td class="title1">出生日期</td>
			<td><asp:TextBox ID="dtpBirthDay" runat="server" cssClass="input2" onfocus="setday(this);" Width="96%"></asp:TextBox></td>
		</tr>
		<tr>
			<td class="title1">籍贯</td>
			<td><asp:TextBox ID="txtState" runat="server"  cssClass="input2" MaxLength="200" Width="96%"></asp:TextBox></td>
			<td class="title1">民族</td>
			<td><asp:DropDownList ID="ddlNation" runat="server" cssClass="input2"  Width="98%"></asp:DropDownList></td>
		</tr>
		<tr>
			<td class="title1">身份证号码</td>
			<td><asp:TextBox ID="txtIdCard" runat="server"  cssClass="input2" MaxLength="18" Width="96%"></asp:TextBox></td>
			<td class="title1">户口所在地</td>
			<td><asp:TextBox ID="txtPermResidence" runat="server"  cssClass="input2" MaxLength="200" Width="96%"></asp:TextBox></td>
		</tr>
		<tr>
			<td class="title1">婚姻状况</td>
			<td><asp:DropDownList ID="ddlMarryFlg" runat="server" cssClass="input2"  Width="98%"></asp:DropDownList></td>
			<td class="title1">排序号</td>
			<td><asp:TextBox ID="numSortCode" runat="server"  cssClass="input2" onbeforepaste="numboxPaste();" onkeypress="isInt();" Width="96%"></asp:TextBox></td>
		</tr>		
		<tr>
			<td class="title1">职务</td>
			<td><asp:TextBox ID="txtDuty" runat="server"  cssClass="input2" MaxLength="200" Width="96%"></asp:TextBox></td>
			<td class="title1">职称</td>
			<td><asp:DropDownList ID="ddlPrincipalship" runat="server" cssClass="input2"  Width="98%"></asp:DropDownList></td>
		</tr>
        <tr>
            <td class="title1">电话(办公)</td>
			<td><asp:TextBox ID="txtOfficePhone" runat="server"  cssClass="input2" MaxLength="30" Width="96%"></asp:TextBox></td>
			<td class="title1">分机(办公)</td>
			<td><asp:TextBox ID="txtFamilyPhone" runat="server"  cssClass="input2" MaxLength="30" Width="96%"></asp:TextBox></td>
            <td class="title1">传真</td>
			<td><asp:TextBox ID="txtFax" runat="server"  cssClass="input2" MaxLength="30" Width="96%"></asp:TextBox></td>            
        </tr>
		<tr>			
            <td class="title1">手机</td>
			<td><asp:TextBox ID="txtMobile" runat="server"  cssClass="input2" MaxLength="30" Width="96%"></asp:TextBox></td>
            <td class="title1">电子邮箱</td>
			<td colspan="3"><asp:TextBox ID="txteMail" runat="server"  cssClass="input2" MaxLength="100" Width="96%"></asp:TextBox></td>
		</tr>
		<tr>			
			<td class="title1">QQ</td>
			<td><asp:TextBox ID="txtQQ" runat="server"  cssClass="input2" MaxLength="30" Width="96%"></asp:TextBox></td>
           <td class="title1">MSN</td>
			<td><asp:TextBox ID="txtMSN" runat="server"  cssClass="input2" MaxLength="100" Width="96%"></asp:TextBox></td>
            <td class="title1">是否系统用户</td>
			<td><asp:CheckBox ID="chkIsUser" runat="server"></asp:CheckBox></td>
		</tr>
        
		<tr>			
            <td class="title1">入职日期</td>
			<td><asp:TextBox ID="dtpEnterDate" runat="server" cssClass="input2" onfocus="setday(this);" Width="96%"></asp:TextBox></td>
			<td class="title1">转正日期</td>
			<td><asp:TextBox ID="dtpTryoutDate" runat="server" cssClass="input2" onfocus="setday(this);" Width="96%"></asp:TextBox></td>
            <td class="title1">是否有效</td>
			<td><asp:CheckBox ID="chkIsValid" runat="server"></asp:CheckBox></td>
		</tr>
		<tr>
			<td class="title1">现居住地</td>
			<td colspan="3"><asp:TextBox ID="txtAddress" runat="server"  cssClass="input2" MaxLength="200" Width="98%"></asp:TextBox></td>
			<td class="title1">邮编</td>
			<td><asp:TextBox ID="numAddPostCode" runat="server"  cssClass="input2" onbeforepaste="numboxPaste();" onkeypress="isInt();" Width="96%"></asp:TextBox></td>
		</tr>
		<tr>
			<td class="title1">家庭地址</td>
			<td colspan="3"><asp:TextBox ID="txtHomeAddress" runat="server"  cssClass="input2" MaxLength="200" Width="98%"></asp:TextBox></td>
			<td class="title1">邮编</td>
			<td><asp:TextBox ID="numHomePostCode" runat="server"  cssClass="input2" onbeforepaste="numboxPaste();" onkeypress="isInt();" Width="96%"></asp:TextBox></td>
		</tr>
		<tr>
			<td class="title1">紧急联系人</td>
			<td><asp:TextBox ID="txtEmContacts" runat="server"  cssClass="input2" MaxLength="200" Width="96%"></asp:TextBox></td>
			<td class="title1">联系电话</td>
			<td><asp:TextBox ID="txtEmContactTEL" runat="server"  cssClass="input2" MaxLength="30" Width="96%"></asp:TextBox></td>
            <td class="title1">联系地址</td>
			<td><asp:TextBox ID="txtEmContactADD" runat="server"  cssClass="input2" MaxLength="200" Width="96%"></asp:TextBox></td>
		</tr>
		<tr>			
            
            <td class="title1">兴趣爱好</td>
			<td colspan="5"><asp:TextBox ID="txtInterest" runat="server" TextMode="MultiLine" Rows="5"   cssClass="input2" MaxLength="200" Width="98%"></asp:TextBox></td>
		</tr>
        
		<tr>
			<td class="title1">备注</td>
			<td  colspan="5"><asp:TextBox ID="txtNotes" runat="server" TextMode="MultiLine"  Rows="5"  cssClass="input2" MaxLength="500" Width="98%"></asp:TextBox></td>
		</tr>
		
    </table>

    <div style="display:none">
    昵称<asp:TextBox ID="txtNickName" runat="server"  cssClass="input2" MaxLength="200" Width="96%"></asp:TextBox>
    手机短号<asp:TextBox ID="txtMobileShotNo" runat="server"  cssClass="input2" MaxLength="30" Width="96%"></asp:TextBox>
    飞信号<asp:TextBox ID="txtFetionMobile" runat="server"  cssClass="input2" MaxLength="30" Width="96%"></asp:TextBox>
    身高<asp:TextBox ID="numHeight" runat="server"  cssClass="input2" onbeforepaste="numboxPaste();" onkeypress="isDecimal();" Width="96%"></asp:TextBox>
	体重<asp:TextBox ID="numWeight" runat="server"  cssClass="input2" onbeforepaste="numboxPaste();" onkeypress="isDecimal();" Width="96%"></asp:TextBox>
     血型<asp:DropDownList ID="ddlBlood" runat="server" cssClass="input2"  Width="98%"></asp:DropDownList>
     户口性质<asp:TextBox ID="txtPRKind" runat="server"  cssClass="input2" MaxLength="200" Width="96%"></asp:TextBox>
     健康情况<asp:DropDownList ID="ddlhealthState" runat="server" cssClass="input2"  Width="98%"></asp:DropDownList>
   员工状态<asp:DropDownList ID="ddlEmplState" runat="server" cssClass="input2"  Width="98%"></asp:DropDownList>
   专长<asp:TextBox ID="txtSpeciality" runat="server"  cssClass="input2" MaxLength="100" Width="96%"></asp:TextBox>
    </div>

       <asp:HiddenField ID="hidDepartmentID" runat="server" />
       <asp:HiddenField ID="hidOuType" runat="server" />
       <asp:HiddenField ID="hidID" runat="server" />
       
        <div class="save_area">
            <asp:Button runat="server" ID="btnOK" Text="确定" class="btn_normal" 
                onmouseover="this.className='btn_active'" 
                onmouseout="this.className='btn_normal'" OnClientClick="return checkCode();" onclick="btnOK_Click"/>
            <input type="button" id="btnExit" value="取消" onclick="javascript:window.returnValue=false;window.close();" class="btn_normal" onmouseover="this.className='btn_active'" onmouseout="this.className='btn_normal'" />
        </div>
</asp:Content>


